package com.javaeye.dengyin2000.gwtmodel.client;

import com.google.gwt.core.client.EntryPoint;

/**
 * Entry point classes define <code>onModuleLoad()</code>.
 */
public class Model implements EntryPoint {

  /**
   * This is the entry point method.
   */
  public void onModuleLoad1() {/*
	  ClassRegistrator.registerAll();
	  final Person person = new Person();
	  person.setAddress("xxxxx");
	  person.setAge(21);
	  person.setBirthday(new Date());
	  person.setName("dengyin");
	  person.setContact(new Contact());
	  person.getContact().setAddress("xxxx1");
	  person.getContact().setTelNo("13760856034");
	  person.getMap().put("name", "dengyin");
	  person.getContact().setLinks(new String[]{"xxxx","xxx1"});
	  
	  Button b = new Button("get value");
	  b.addClickListener(new ClickListener(){

		public void onClick(Widget sender) {
			  try {
					Window.alert((String) PropertyUtils.getProperty(person, "contact.telNo"));
					Window.alert(((Date) PropertyUtils.getProperty(person, "birthday")).toString());
					Window.alert((String) PropertyUtils.getProperty(person, "map.name"));
					Window.alert((String) PropertyUtils.getProperty(person, "map(name)"));
					Window.alert((String) PropertyUtils.getProperty(person, "contact.links[1]"));
				} catch (Exception e){
					
				}
		}
		  
	  });
	  
	  Button b1 = new Button("set value");
	  b1.addClickListener(new ClickListener(){

		public void onClick(Widget sender) {
			try {
				PropertyUtils.setProperty(person, "contact.telNo", "362000");
				PropertyUtils.setProperty(person, "birthday", new Date());
				PropertyUtils.setProperty(person, "map.name", "fuliang");
				PropertyUtils.setProperty(person, "map(name)", "fuliang");
				PropertyUtils.setProperty(person, "contact.links[1]", "sunshine");
			} catch (IllegalAccessException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			} catch (InvocationTargetException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			} catch (NoSuchMethodException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			} catch (ClassNotFoundException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
		  
	  });
	  
	  RootPanel.get().add(b);
	  RootPanel.get().add(b1);
  */}
  
	  public void onModuleLoad() {
		// TODO Auto-generated method stub
		
	}
}
